import { createStore } from "vuex";

import user from "./modules/user";
import common from "./modules/common";
import business from "./modules/business";

export default createStore({
  modules: {
    business,
    user,
    common,
  },
  state: {},
  mutations: {},
  getters: {
    isLogin: (state) => !!state.user.token,
    userInfo: (state) => state.user.userInfo,
    roleId: (state) => state.user.roleId,
    roleInfo: (state) => state.user.roleInfo,
    loginInfo: (state) => state.user.loginInfo,
    token: (state) => state.user.token,
    currdeptInfo: (state) => state.user.currdeptInfo,
    customerInfo: (state) => state.business.customerInfo,
    globalFontSize: (state) => state.globalFontSize,
    lang: (state) => state.lang,
    version: (state) => state.version,
    tenantConfig: (state) => state.tenant.config,
    theme: (state) => state.common.theme,
  },
  actions: {},
});
